/**
 *
 * @Author: Marek Zakowicz <mazak (at) debian (dot) linux.org.pl>
 *
 * Copyright (c) 2005, 2006, 2007 Marek Zakowicz. All rights reserved.
 *
 * Licence: This code may be used, (re)distribute and/or modify under the terms one of the following two kinds of licence:
 *          1) as free software under GPL 3 (General Public Licence ver. 3 as published by the Free Software Foundation)
 *          2) as software under the terms individual licence from Marek Zakowicz
 *
 *          This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *          without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */

package jsp2php;

interface ITranslator {
   Translation field(String id) throws TranslatorException;
   Translation call(String id, Translation ... args) throws TranslatorException;

   // Returns canonical, Java name of translated type (eg. java.lang.Boolean or boolean)
   String      name();

   // Returns PHP name of translated type (eg. bool)
   String      php_name() throws TranslatorException;
}

interface IValueTranslator extends ITranslator {
   Translation literal(String value) throws TranslatorException;
   Translation add(Translation left, Translation right) throws TranslatorException;
   Translation add_eq(Translation left, Translation right) throws TranslatorException;
   Translation div(Translation left, Translation right) throws TranslatorException;
   Translation div_eq(Translation left, Translation right) throws TranslatorException;
}

/**
 * @composed 1 - 1 IValueTranslator
 */
interface ITypeTranslator extends ITranslator {
   IValueTranslator value_translator();
}
